﻿using UnityEngine;
using System.Collections;

public class ZT_BehaviourController : MonoBehaviour
{
    public static ZT_BehaviourController ins;


    public void UpdateMS()
    {
        foreach (ZT_Game_Behaviour obj in objs)
        {
            obj.ZT_UpdateMS();
        }
    }
    public void LateUpdateMS()
    {
        foreach (ZT_Game_Behaviour obj in objs)
        {
            obj.ZT_LateUpdateMS();
        }
    }
    void Awake()
    {
        ins = this;
    }


    public void RemoveObject(ZT_Game_Behaviour obj)
    {
        objs.Remove(obj);
        obj.ZT_OnDestroy();
    }

    public void AddObject(ZT_Game_Behaviour obj)
    {
        objs.Add(obj);
        obj.ZT_Start();

    }
    public void Start()
    {
        //  ins = this;
    }

    public ArrayList objs = new ArrayList();

}
